Port consent updates from springfield#17299
Open
stephaniehobson wants to merge 1 commit into
Open
Conversation
Ports the basic consent mode configuration from springfield but does not port the download attribution or promoted pages concept. Original JIRA ticket: https://mozilla-hub.atlassian.net/browse/WT-602 Completed in: mozmeao/springfield#955
Contributor
There was a problem hiding this comment.
Pull request overview
Ports the baseline Google Consent Mode behavior from springfield into Bedrock’s existing consent + GTM integration, ensuring gtag consent defaults are set before GTM loads and consent updates are applied when user preferences change.
Changes:
- Added
setGtagAdsConsentMode/setGtagAnalyticsConsentModehelpers to centralize gtag consent-mode updates. - Updated the GTM snippet to set consent defaults prior to loading GTM and to apply consent updates on
mozConsentStatus. - Expanded Jasmine unit coverage for the new consent-mode behavior in both consent utils and GTM snippet specs.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| tests/unit/spec/base/gtm/gtm-snippet.js | Adds unit tests for gtag consent defaults and consent update handling. |
| tests/unit/spec/base/consent/consent-utils.js | Adds unit tests for new gtag consent-mode helper utilities. |
| media/js/base/gtm/gtm-snippet.es6.js | Initializes dataLayer, sets consent defaults before loading GTM, and updates consent on consent events. |
| media/js/base/consent/utils.es6.js | Introduces gtag consent-mode helper functions and calls them after setting the consent cookie. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
One-line summary
Ports the basic consent mode configuration from springfield but does not port the download attribution or promoted pages concept.
Significant changes and points to review
Issue / Bugzilla link
Original JIRA ticket: https://mozilla-hub.atlassian.net/browse/WT-602
Completed in: mozmeao/springfield#955
Testing
Available on Demo 3:
https://www-demo3.allizom.org/en-US/
GTM is loaded according to usual gates (respecting DNT/GPC, consent-required, analytics cookie)
When GTM is loaded:
When user indicates pref, an 'update' dataLayer event appears:
Google verification docs: https://developers.google.com/tag-platform/security/guides/consent-debugging#start-debugging